package com.whxy02.tolearn.app.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.whxy02.tolearn.app.beans.Error;
import com.whxy02.tolearn.app.dao.ErrorDao;
import com.whxy02.tolearn.app.service.ErrorService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


@Service
public class ErrorServiceImpl implements ErrorService {
    private QueryWrapper<Error> wrapper=new QueryWrapper<>();
    @Resource
    ErrorDao errorDao;

    @Override
    public List<Error> getAll() throws Exception {
        return errorDao.selectList(null);
    }

    @Override
    public Error getById(Integer id) throws Exception {
        return errorDao.selectById(id);
    }

    @Override
    public int save(Error error) throws Exception {
        return errorDao.insert(error);
    }

    @Override
    public int removeById(Integer id) throws Exception {
        return errorDao.deleteById(id);
    }

    @Override
    public int change(Error error) throws Exception {
        return errorDao.updateById(error);
    }
}
